package com.ruoyi.gams.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gams.mapper.GamsDeviceMediaMapper;
import com.ruoyi.gams.domain.GamsDeviceMedia;
import com.ruoyi.gams.service.IGamsDeviceMediaService;

/**
 * 设备资源Service业务层处理
 *
 * @author ruoyi
 */
@Service
public class GamsDeviceMediaServiceImpl implements IGamsDeviceMediaService
{
    @Autowired
    private GamsDeviceMediaMapper gamsDeviceMediaMapper;

    /**
     * 查询设备资源
     *
     * @param id 设备资源主键
     * @return 设备资源
     */
    @Override
    public GamsDeviceMedia selectGamsDeviceMediaById(Integer id)
    {
        return gamsDeviceMediaMapper.selectGamsDeviceMediaById(id);
    }

    /**
     * 查询设备资源列表
     *
     * @param gamsDeviceMedia 设备资源
     * @return 设备资源
     */
    @Override
    public List<GamsDeviceMedia> selectGamsDeviceMediaList(GamsDeviceMedia gamsDeviceMedia)
    {
        return gamsDeviceMediaMapper.selectGamsDeviceMediaList(gamsDeviceMedia);
    }

    /**
     * 新增设备资源
     *
     * @param gamsDeviceMedia 设备资源
     * @return 结果
     */
    @Override
    public int insertGamsDeviceMedia(GamsDeviceMedia gamsDeviceMedia)
    {
        gamsDeviceMedia.setCreateTime(DateUtils.getNowDate());
        return gamsDeviceMediaMapper.insertGamsDeviceMedia(gamsDeviceMedia);
    }

    /**
     * 修改设备资源
     *
     * @param gamsDeviceMedia 设备资源
     * @return 结果
     */
    @Override
    public int updateGamsDeviceMedia(GamsDeviceMedia gamsDeviceMedia)
    {
        gamsDeviceMedia.setUpdateTime(DateUtils.getNowDate());
        return gamsDeviceMediaMapper.updateGamsDeviceMedia(gamsDeviceMedia);
    }

    /**
     * 批量删除设备资源
     *
     * @param ids 需要删除的设备资源主键
     * @return 结果
     */
    @Override
    public int deleteGamsDeviceMediaByIds(Integer[] ids)
    {
        return gamsDeviceMediaMapper.deleteGamsDeviceMediaByIds(ids);
    }

    /**
     * 删除设备资源信息
     *
     * @param id 设备资源主键
     * @return 结果
     */
    @Override
    public int deleteGamsDeviceMediaById(Integer id)
    {
        return gamsDeviceMediaMapper.deleteGamsDeviceMediaById(id);
    }
}
